:root {
    --hover-color: var(--bar-hover-color) !important;
}
::-webkit-scrollbar {
    display: none;
}
html {
    cursor: none;
}
body {
    cursor: default;
    user-select: none;
    overflow: hidden;
}
html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}

/* 桌面切换 */
#windows_bar {
    background-color: var(--bar-bg);
    width: 250px;
    position: fixed;
    z-index: 100;
    backdrop-filter: var(--blur);
    transition: var(--transition);
    overflow: scroll;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    transform: translateX(-100%);
}
#windows_bar > div {
    margin-bottom: 16px;
}
#windows_bar_close {
    border: none;
    transition: var(--transition);
    border-radius: var(--border-radius);
    width: 36px;
    height: 36px;
    background-color: #0000;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    left: 200px;
    z-index: 2;
}
#windows_bar_close > .icon {
    width: 24px;
    left: 6px;
    top: 6px;
}
#windows_bar_close:hover {
    background-color: var(--hover-color);
}

.window {
    transition: var(--transition);
    padding: 8px;
}
.window:hover {
    background-color: var(--hover-color);
    transition: var(--transition);
}
.window_icon {
    height: 2rem;
    vertical-align: middle;
}
.window_title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 0 0 8px;
}
#window_photo {
    overflow: hidden;
    border-radius: 8px;
}
.window_thumbnail {
    width: 100%;
    display: block;
}
#windows_bar > #screens {
    display: flex;
    justify-content: center;
    flex-direction: column;
}
#windows_bar > #screens > div > canvas {
    width: 100%;
}
#img_history > div > img {
    width: 100%;
    display: block;
    border-radius: 6px;
}
#img_history > div {
    position: relative;
    margin-bottom: 8px;
    padding: 2px;
    box-sizing: border-box;
    background-color: var(--bar-bg);
    backdrop-filter: var(--blur);
    border-radius: var(--border-radius);
}
#img_history > div > button {
    position: absolute;
    right: 0;
    top: 0;
    border: none;
    outline: none;
    width: 16px;
    height: 16px;
    border-radius: var(--border-radius);
    background: none;
    transition: var(--transition);
    background-color: var(--bar-bg);
}
#img_history > div > button > .icon {
    width: 16px;
}
#img_history > div > button:hover {
    background-color: #f00;
}
#img_history > div > button:hover > .icon {
    filter: invert(1);
}

/* 居中栏 */
#center_bar {
    position: fixed;
    left: 50%;
    top: 35%;
    transform: translateX(-50%);
    z-index: 111;
    pointer-events: none;
    background-color: var(--bar-bg);
    backdrop-filter: var(--blur);
    opacity: 0;
    transition: var(--transition);
    padding: 2px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
#center_bar > div {
    overflow: hidden;
}
/* 保存 */
#save_type > #suffix > div {
    padding: 0 4px;
}
#save_type > #suffix > div,
#save_type > div:nth-child(1) {
    text-align: center;
    line-height: 2rem;
    border-radius: 6px;
    transition: var(--transition);
}
#save_type > #suffix > div:hover,
.suffix_h {
    background-color: var(--hover-color);
}
/* 命令 */
#draw_edit {
    display: grid;
    grid-template-columns: auto 36px;
    grid-template-rows: 36px auto;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
}
#draw_edit > input {
    border: none;
    height: 36px;
    padding: 0;
    margin: 0 4px;
    background-color: #0000;
    width: 300px;
    font-size: 1rem;
}
#draw_edit_run,
#draw_edit_clear {
    border: none;
    transition: var(--transition);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 36px;
    padding: 0;
    background-color: #0000;
    flex-shrink: 0;
    position: relative;
}
#draw_edit_run > .icon,
#draw_edit_clear > .icon {
    width: 36px;
    left: 0;
    top: 0;
}
#draw_edit_run:hover,
#draw_edit_clear:hover {
    background-color: var(--hover-color);
}
#draw_edit_output {
    grid-area: 2 / 1 / 3 / 4;
}

/* 工具 */
#tool_bar {
    width: var(--bar-size);
    background: var(--bar-bg);
    position: fixed;
    z-index: 99;
    left: 10px;
    top: 100px;
    backdrop-filter: var(--blur);
    border-radius: calc(var(--bar-size) / 6);
    overflow: hidden;
    transition: opacity var(--transition);
    box-shadow: var(--shadow);
}
#tool_bar > div {
    width: var(--bar-size);
    height: var(--bar-size);
    border-radius: calc(var(--bar-size) / 6);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
#tool_bar > div > .icon {
    width: calc(var(--bar-size) * var(--bar-icon));
    left: calc(var(--bar-size) * (1 - var(--bar-icon)) / 2);
    top: calc(var(--bar-size) * (1 - var(--bar-icon)) / 2);
}
#tool_bar > div:hover {
    background-color: var(--hover-color);
    transition: var(--transition);
}
#tool_copy {
    cursor: copy !important;
}

.side_select {
    position: absolute;
    width: 10px;
    height: 10px;
    border: none;
    appearance: none;
    color: #0000;
    right: 2px;
    top: 2px;
    border-radius: 5px;
    background-color: var(--bar-bg);
}
.side_select > option {
    color: var(--color);
}

/* 画 */
#draw_bar {
    left: 80px;
    top: 100px;
    width: var(--bar-size);
    height: calc(var(--bar-size) * 6);
    background: var(--bar-bg);
    position: fixed;
    z-index: 98;
    backdrop-filter: var(--blur);
    border-radius: calc(var(--bar-size) / 6);
    overflow-y: scroll;
    overflow-x: hidden;
    transition: width var(--transition), opacity var(--transition);
    box-shadow: var(--shadow);
    display: flex;
}
#draw_bar > div {
    width: var(--bar-size);
}
#draw_main > div,
.draw_items > div,
.draw_items > lock-b {
    width: var(--bar-size);
    height: var(--bar-size);
    border-radius: calc(var(--bar-size) / 6);
    transition: var(--transition);
    position: relative;
}
#draw_main > div::before,
.draw_items > div::before,
.draw_items > lock-b::before {
    color: var(--icon-color);
    vertical-align: middle;
}
#draw_main > div > .icon,
.draw_items > div > .icon,
.draw_items > lock-b > .icon {
    width: calc(var(--bar-size) * var(--bar-icon));
    left: calc(var(--bar-size) * (1 - var(--bar-icon)) / 2);
    top: calc(var(--bar-size) * (1 - var(--bar-icon)) / 2);
}
#draw_main > div:hover,
.draw_items > div:hover {
    background-color: var(--hover-color);
    transition: var(--transition);
}
.draw_items {
    transition: var(--transition);
    overflow: scroll;
}
#draw_side {
    overflow: scroll;
    scroll-behavior: smooth;
    flex-shrink: 0;
}

#editor {
    position: absolute;
    transform-origin: 0% 0%;
}
#editor > * {
    position: absolute;
}

.editor_bg {
    background-color: var(--bg);
}
.editor_bg > #editor > * {
    box-shadow: var(--shadow);
}

#main_photo {
    z-index: 8;
    image-rendering: pixelated;
}
#clip_photo {
    z-index: 10;
    cursor: crosshair;
    image-rendering: pixelated;
}
#draw_photo_top {
    z-index: 9;
}

#mouse_bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    z-index: 100;
    padding: 2px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    background: var(--bar-bg);
    overflow: hidden;
    pointer-events: none;
    left: 100%;
    top: 100%;
}
.mouse_bar_hide {
    transition: var(--transition);
    opacity: 0;
}
#point_color {
    width: var(--color-size);
    height: var(--color-size);
    overflow: hidden;
    transition: var(--transition);
    display: grid;
    grid-template-columns: repeat(var(--color-i-i), var(--color-i-size));
    grid-template-rows: repeat(var(--color-i-i), var(--color-i-size));
    border-radius: 6px;
}
#point_color_t_c {
    box-shadow: #000 0 0 0 1px, #fff 0 0 0 2px;
    position: relative;
    z-index: 2;
}
#point_color_t_b {
    box-shadow: #0005 0 0 0 0.25px inset, #fff5 0 0 0 0.5px inset;
    opacity: 0.5;
}
#clip_xy {
    font-family: var(--monospace);
    cursor: copy;
    width: 100%;
}
#clip_copy {
    font-family: var(--monospace);
    width: 100%;
    transition: var(--transition);
    overflow: hidden;
    border-radius: 6px;
    cursor: copy;
}
#clip_copy > div {
    position: relative;
    top: 0px;
    transition: var(--transition);
}
#clip_xy,
#clip_copy > div > div:nth-child(1),
#clip_copy > div > div:not(:nth-child(1)) > div {
    height: 32px;
    line-height: 32px;
    transition: background-color var(--transition);
    text-align: center;
    border-radius: 6px;
    white-space: nowrap;
}
#clip_copy > div > div:not(:nth-child(1)) {
    border-radius: 6px;
}
#clip_xy:hover,
#clip_copy > div > div:nth-child(1):hover,
#clip_copy > div > div > div:hover {
    background-color: var(--hover-color);
}
.clip_copy {
    width: 200px !important;
    height: 192px !important;
}
.clip_copy_h {
    width: var(--color-size) !important;
    height: 32px !important;
}
.clip_copy > div {
    top: 0 !important;
}
#clip_wh {
    position: absolute;
    z-index: 11;
    backdrop-filter: var(--blur);
    background: var(--bar-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
}
#clip_wh > div:focus {
    outline: none;
}
#clip_wh > div {
    cursor: text;
    margin: 8px;
    font-family: var(--monospace);
}
#x0y0,
#x1y1 {
    display: none;
}

#waiting {
    position: fixed;
    display: none;
    z-index: 11;
    cursor: progress;
    transform-origin: top left;
}

#loading {
    position: fixed;
    z-index: 100;
    padding: 4px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    background: var(--bar-bg);
    transition: var(--transition);
}
#loading::after {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 0.125em solid;
    border-radius: 1em;
    border-right-color: transparent;
    content: "";
    animation: spinner 0.75s linear infinite;
    box-sizing: border-box;
    margin-left: 0.25em;
}
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.loading_hide {
    pointer-events: none;
    opacity: 0;
}

#ocr_error {
    position: fixed;
    z-index: 100;
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    background: var(--bar-bg);
    transition: var(--transition);
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#ocr_error > div:last-child {
    width: 100%;
    border-radius: var(--border-radius);
    background-color: var(--bar-bg);
    transition: var(--transition);
    text-align: center;
}
#ocr_error > div:last-child:hover {
    background-color: var(--hover-color);
    color: var(--bg);
}
.ocr_err_hide {
    pointer-events: none;
    opacity: 0;
}

/* long */
#long_rect {
    position: fixed;
    outline: 1px dashed #000;
}

#long_finish {
    width: 16px;
    height: 16px;
    background-color: #f00;
    border-radius: 8px;
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

#long_finish:hover {
    background-color: #0000;
}

/* 录屏 */

#recorder_rect {
    position: fixed;
    outline: 1px dashed #000;
}

#mouse_c {
    display: none;
    position: fixed;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: #ff08;
}

#recorder_bar {
    position: absolute;
    right: 4px;
    bottom: 4px;
}

#recorder_mouse {
    display: flex;
}

#recorder_mouse > div:nth-child(1) {
    width: 8px;
    height: 16px;
    border-radius: 4px 0 0 4px;
    margin-right: -2px;
}
#recorder_mouse > div:nth-child(2) {
    width: 4px;
    height: 8px;
    border-radius: 2px;
    margin-right: -2px;
}
#recorder_mouse > div:nth-child(3) {
    width: 8px;
    height: 16px;
    border-radius: 0 4px 4px 0;
}
